import time

import allure
from selenium.webdriver.common.by import By
from common.basepage import BasePage
from conf.constant import cons


class CommodityPage(BasePage):
    """商品页面"""
    #  _locator = (By.XPATH, '')

    """服务页面元素"""
    # 服务标签
    serveLabel_locator = (By.XPATH, '//*[@class="page-title"]/li[2]')
    # 新增按钮，卡项、产品页面共用
    newAdd_btn_locator = (By.XPATH, '//div[@class="headquarters_Label"]/span[1]')
    # 服务上下架状态按钮
    serve_upDown_locator = (By.XPATH, '//*[@id="pane-1"]/div[2]/ul/li[3]/div[2]/div/div')
    # 服务上下架状态-上架选项
    serve_putaway_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="已上架"]')
    # 服务上下架状态-下架选项
    serve_unshelve_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="已下架"]')

    # 编辑按钮，随机选择一个，卡项、产品页面共用
    serveEdit_btn_locator = (By.XPATH, '//*[@class="el-table__fixed-right"]//a[text()="编辑"]')
    # 下架按钮，随机选择一个，卡项、产品页面共用
    unshelve_btn_locator = (By.XPATH, '//*[@class="el-table__fixed-right"]//a[text()="下架"]')
    # 上架按钮，随机选择一个，卡项、产品页面共用
    putaway_btn_locator = (By.XPATH, '//*[@class="el-table__fixed-right"]//a[text()="上架"]')
    # 上下架取消按钮，卡项、产品页面共用
    cancel_upDown_locator = (By.XPATH, '//*[@aria-label="提示"]//div[@class="el-message-box__btns"]/button[1]')
    # 上下架确定按钮，卡项、产品页面共用
    confirm_upDown_locator = (By.XPATH, '//*[@aria-label="提示"]//div[@class="el-message-box__btns"]/button[2]')
    # 提示信息，通用
    prompt_msg_locator = (By.XPATH, '//*[@class="el-message__content"]')
    # 总部服务第一行的服务名称
    HQ_Name_locator = (By.XPATH, '//*[@id="pane-1"]/div[3]/div/div[3]//tr[1]/td[1]/div')
    # 查询输入框
    HQ_searchInput_locator = (By.XPATH, '//*[@id="pane-1"]/div[2]/ul//div[2]/div/input')
    # 查询按钮
    HQ_searchBtn_locator = (By.XPATH, '//*[@id="pane-1"]//input[contains(@placeholder,"输入")]/following-sibling::span')
    """新增服务页面元素"""
    # 服务名称输入框
    serveName_input_locator = (By.XPATH, ' //*[@placeholder="请输入20字以内的服务名称"]')
    # 服务分类下拉框
    serveCategory_btn_locator = (By.XPATH, '//div[@class="el-input el-input--suffix"]')
    # 服务分类选项，随机选择一个
    serveCategory_options_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li')
    # 服务标签下拉框
    serveLabel_btn_locator = (By.XPATH, '//div[@class="el-input el-input--medium el-input--suffix"]')
    # 服务标签，随机选择一个
    serveLabel_options_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li')
    # 上传图片,和产品共用
    upload_locator = (By.XPATH, '//*[@class="uploadBtn"]/input')
    # 售价输
    price_input_locator = (By.XPATH, '//*[contains(text(),"售价")]/following-sibling::input')
    # 划线价输入框
    linePrice_input_locator = (By.XPATH, '//*[contains(text(),"划线价")]/following-sibling::input')
    # 服务时长
    # 时长减少按钮
    duration_decrease_locator = (By.XPATH, '//*[@class="barCode"]//span[@class="el-input-number__decrease"]')
    # 时长增加按钮
    duration_increase_locator = (By.XPATH, '//*[@class="barCode"]//span[@class="el-input-number__increase"]')
    # 网店展示单选框
    # 展示选项
    onlineStore_show_locator = (By.XPATH, '//*[@class="el-radio__label" and text()="展示"]')
    # 不展示选项
    onlineStore_noshow_locator = (By.XPATH, '//*[@class="el-radio__label" and text()="不展示"]')
    # 上下架单选框
    # 上架选项
    putaway_locator = (By.XPATH, '//*[@class="el-radio__label" and text()="上架"]')
    # 不上架选项
    noPutaway_locator = (By.XPATH, '//*[@class="el-radio__label" and text()="不上架"]')
    # 排序
    # 排序增加按钮
    sort_increase_locator = (By.XPATH, '//*[contains(text(),"排序")]/..//span[@class="el-input-number__increase"]')
    # 适用门店单选框-默认全部门店
    # 全部门店选项
    allStore_option_locator = (By.XPATH, '//*[@class="el-radio__label" and text()="全部门店"]')
    # 自定义选项，后续有需要再扩展
    userDefined_option_locator = (By.XPATH, '//*[@class="el-radio__label" and text()="自定义"]')
    # 服务详情输入框
    serveDetail_input_locator = (By.XPATH, '//*[@class="ql-editor ql-blank"]')
    # 提交服务按钮
    submit_btn_locator = (By.XPATH, '//*[contains(@class,"submit-btn")]/span[1]')
    # 取消按钮
    cancel_btn_locator = (By.XPATH, '//*[contains(@class,"submit-btn")]/span[2]')

    """管理服务分类弹窗页面元素"""
    # 管理服务分类按钮
    manage_serveCategory_locator = (By.XPATH, '//div[@class="headquarters_Label"]/span[2]')
    # 新增分类按钮
    newCategory_btn_locator = (By.XPATH, '//*[text()="新增分类"]')
    # 分类名称输入框
    categoryName_input_locator = (By.XPATH, '//*[text()="添加分类"]/following-sibling::div/input')
    # 确定按钮
    confirm_Category_locator = (By.XPATH, '//*[@x-placement="right"]//*[@class="el-button el-button--primary el-button--mini"]')
    # 取消按钮
    cancel_Category_locator = (By.XPATH, '//*[@x-placement="right"]//*[@class="el-button el-button--default el-button--mini"]')
    # 编辑按钮
    edit_Category_locator = (By.XPATH, '//*[@aria-label="管理服务分类"]//ul[2]/li[4]/span[1]')
    # 编辑分类名称输入框
    edit_categoryName_locator = (By.XPATH, '//*[@aria-label="管理服务分类"]//ul[2]/li[1]//input')
    # 编辑保存按钮
    edit_saveBtn_locator = (By.XPATH, '//*[@aria-label="管理服务分类"]//ul[2]/li[1]/div/span[1]')
    # 删除按钮
    del_Category_locator = (By.XPATH, '//*[@aria-label="管理服务分类"]//ul[2]/li[4]/span[2]')
    # 分类名称
    Category_name_locator = (By.XPATH, '//*[@aria-label="管理服务分类"]//ul[2]/li[1]/span')
    # 关闭管理服务分类弹窗按钮
    cancel_CategoryPopup_locator = (By.XPATH, '//*[@aria-label="管理服务分类"]/div/button')

    """管理服务标签弹窗页面元素"""
    # 管理服务标签按钮
    manage_serveLabel_locator = (By.XPATH, '//div[@class="headquarters_Label"]/span[3]')
    # 新增标签按钮
    newServeLabel_btn_locator = (By.XPATH, '//*[text()="新增标签"]')
    # 标签名称输入框
    serveLabelName_input_locator = (By.XPATH, '//*[text()="添加标签"]/following-sibling::div/input')
    # 确定按钮
    confirm_serveLabel_locator = (By.XPATH, '//*[@x-placement="right"]//*[@class="el-button el-button--primary el-button--mini"]')
    # 取消按钮
    cancel_serveLabel_locator = (By.XPATH, '//*[@x-placement="right"]//*[@class="el-button el-button--default el-button--mini"]')
    # 编辑按钮
    edit_serveLabel_locator = (By.XPATH, '//*[@aria-label="管理服务标签"]//ul[2]/li[4]/span[1]')
    # 编辑标签名称输入框
    edit_serveLabelName_locator = (By.XPATH, '//*[@aria-label="管理服务标签"]//ul[2]/li[1]//input')
    # 编辑保存按钮
    edit_serveLabelSave_locator = (By.XPATH, '//*[@aria-label="管理服务标签"]//ul[2]/li[1]/div/span[1]')
    # 删除按钮
    del_serveLabel_locator = (By.XPATH, '//*[@aria-label="管理服务标签"]//ul[2]/li[4]/span[2]')
    # 标签名称
    serveLabel_name_locator = (By.XPATH, '//*[@aria-label="管理服务标签"]//ul[2]/li[1]/span')
    # 关闭管理服务标签弹窗按钮
    cancel_serveLabelPopup_locator = (By.XPATH, '//*[@aria-label="管理服务标签"]/div/button')

    """门店服务页面元素"""
    # 门店服务标签
    storeServe_label_locator = (By.XPATH, '//div[@class="el-tabs__item is-top"]/span[text()="门店服务"]')
    # 查看按钮，随机选择一个
    check_shopServe_locator = (By.XPATH, '//*[@class="el-table__fixed-right"]//a[text()="查看"]')
    # 总部服务第一行的服务名称
    shop_serveName_locator = (By.XPATH, '//*[@id="pane-2"]/div[2]/div/div[3]/table/tbody/tr[1]/td[1]/div')
    # 查询输入框
    shopServe_searchInput_locator = (By.XPATH, '//*[@id="pane-2"]//input[contains(@placeholder,"输入")]')
    # 查询按钮
    shopServe_searchBtn_locator = (By.XPATH, '//*[@id="pane-2"]//input[contains(@placeholder,"输入")]/following-sibling::span')
    # 查看服务详情信息
    shopServe_detail_locator = (By.XPATH, '//*[text()="基本信息"]')



    """卡项页面元素"""
    # 卡项标签
    cardOption_label_locator = (By.XPATH, '//*[@class="page-title"]/li[2]')
    # 门店卡项标签
    shopCardOption_label_locator = (By.XPATH, '//*[@class="el-tabs__nav is-top"]/div[3]')
    # 选择分类按钮
    cardOption_btn_locator = (By.XPATH, '//*[@id="pane-1"]/div[2]/ul/li[1]/div[2]/div/div[1]/input')
    # 卡项分类选项-次卡
    cardOption_countCard_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="次卡"]')
    # 卡项分类选项-折扣卡
    cardOption_discountCard_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="折扣卡"]')
    # 卡项分类选项-充值卡
    cardOption_rechargeCard_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="充值卡"]')
    # 卡项分类选项-套卡
    cardOption_SetCard_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="套卡"]')
    # 卡项分类选项-时限卡
    cardOption_timeLimitCard_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="时限卡"]')
    # 卡项上下架状态按钮
    cardOption_upDown_locator = (By.XPATH, '//*[@id="pane-1"]/div[2]/ul/li[2]/div[2]/div/div[1]')
    # 卡项上下架状态-上架选项
    cardOption_putaway_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="已上架"]')
    # 卡项上下架状态-下架选项
    cardOption_unshelve_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="已下架"]')

    """新增卡项页面元素"""
    # 卡项名称输入框
    cardOption_name_locator = (By.XPATH, '//*[@placeholder="请输入20字以内的卡项名称"]')

    """次卡"""
    # 适用门店单选框，默认全部门店，元素定位和新增服务页面的共用
    # 添加服务按钮
    add_serve_locator = (By.XPATH, '//*[@class="addbtn"]')
    """添加服务弹窗"""
    # 服务勾选框，随机一个
    serve_checkboxs_locator = (By.XPATH, '//*[@class="server-table"]/li//span[@class="el-checkbox__input"]')
    # 确定按钮
    countCard_confirm_locator = (By.XPATH, '//*[@aria-label="次卡管理服务"]//button[@class="el-button el-button--primary"]')
    # 选择有效期，选择一天
    indate_select_locator = (By.XPATH, '//div[contains(text(),"有效期")]/following-sibling::label[2]/span[1]')
    # 卡片样式,默认
    # 备注输入框,其他卡项共用
    remark_input_locator = (By.XPATH, '//textarea[@class="reamrk"]')
    # 售价输入框，元素定位和新增服务页面的共用
    # 划线价输入框，元素定位和新增服务页面的共用
    # 网店展示单选框，元素定位和新增服务页面的共用
    # 上下架单选框，元素定位和新增服务页面的共用
    # 排序增加按钮，元素定位和新增服务页面的共用
    # 提交卡项按钮，元素定位和新增服务页面的共用

    """折扣卡"""
    # 折扣卡选择框
    discountCard_checkbox_locator = (By.XPATH, '//span[text()="折扣卡"]')
    # 卡项名称输入框
    # 适用门店单选框，默认全部门店，元素定位和新增服务页面的共用
    # 添加服务按钮，元素定位和次卡的共用
    """添加服务弹窗"""
    # 服务勾选框，随机选择一个，元素定位和次卡的共用
    # 确定按钮
    discountCard_confirm_locator = (By.XPATH, '//*[@aria-label="折扣卡管理服务"]//button[@class="el-button el-button--primary"]')
    # 选择有效期，元素定位和次卡的共用
    # 单选卡片样式，元素定位和次卡的共用
    # 备注输入框，元素定位和次卡的共用
    # 售价输入框，元素定位和新增服务页面的共用
    # 划线价输入框，元素定位和新增服务页面的共用
    # 网店展示单选框，元素定位和新增服务页面的共用
    # 上下架单选框，元素定位和新增服务页面的共用
    # 排序增加按钮，元素定位和新增服务页面的共用
    # 提交卡项按钮，元素定位和新增服务页面的共用

    """充值卡"""
    # 充值卡选择框
    rechargeCard_checkbox_locator = (By.XPATH, '//span[text()="充值卡"]')
    # 卡项名称输入框，元素定位和次卡的共用
    # 适用门店单选框，默认全部门店，元素定位和新增服务页面的共用
    # 选择有效期，元素定位和次卡的共用
    # 单选卡片样式，元素定位和次卡的共用
    # 备注输入框，元素定位和次卡的共用
    # 充值金额输入框
    rechargeAmount_input_locator = (By.XPATH, '//*[contains(text(),"充值金额")]/following-sibling::input')
    # 赠送金额输入框
    givenAmount_input_locator = (By.XPATH, '//*[contains(text(),"赠送金额")]/following-sibling::input')
    # 划线价输入框，元素定位和新增服务页面的共用
    # 网店展示单选框，元素定位和新增服务页面的共用
    # 上下架单选框，元素定位和新增服务页面的共用
    # 排序增加按钮，元素定位和新增服务页面的共用
    # 提交卡项按钮，元素定位和新增服务页面的共用

    """套卡"""
    # 套卡选择框
    SetCard_checkbox_locator = (By.XPATH, '//span[text()="套卡"]')
    # 卡项名称输入框，元素定位和次卡的共用
    # 适用门店单选框，默认全部门店，元素定位和新增服务页面的共用
    # 添加服务按钮
    add_serveP_locator = (By.XPATH, '//*[@class="addbtn" and text()="添加服务"]')
    """添加服务弹窗"""
    # 服务勾选框，随机一个，元素定位和次卡的共用
    # 确定按钮
    SetCard_confirm_locator = (By.XPATH, '//*[@aria-label="套卡管理服务"]//button[@class="el-button el-button--primary"]')

    # 添加产品按钮
    add_product_locator = (By.XPATH, '//*[@class="addbtn" and text()="添加产品"]')
    """添加产品弹窗"""
    # 添加按钮
    add_btn_locator = (By.XPATH, '//*[text()="添加"]')
    # 商品规格多选，必须全选，用for循环遍历
    standard_select_locator = (By.XPATH, '//*[@x-placement="bottom"]//li')
    # 商品规格确定按钮
    standard_confirm_locator = (By.XPATH, '//*[contains(@x-placement,"o")]//button[@class="el-button el-button--primary el-button--mini"]')
    # 确定按钮
    product_confirm_locator = (By.XPATH, '//*[@aria-label="套卡管理产品"]//button[@class="el-button el-button--primary"]')

    # 选择有效期，元素定位和次卡的共用
    # 单选卡片样式，元素定位和次卡的共用
    # 备注输入框，元素定位和次卡的共用
    # 售价输入框，元素定位和新增服务页面的共用
    # 划线价输入框，元素定位和新增服务页面的共用
    # 网店展示单选框，元素定位和新增服务页面的共用
    # 上下架单选框，元素定位和新增服务页面的共用
    # 排序增加按钮，元素定位和新增服务页面的共用
    # 套卡详情输入框
    SetCardDetail_input_locator = (By.XPATH, '//div[@class="ql-editor ql-blank"]')
    # 提交卡项按钮，元素定位和新增服务页面的共用
    """时限卡"""
    # 时限卡选择框
    timeLimitCard_checkbox_locator = (By.XPATH, '//span[text()="时限卡"]')
    # 卡项名称输入框，元素定位和次卡的共用
    # 适用门店单选框，默认全部门店，元素定位和新增服务页面的共用
    # 添加服务按钮，元素定位和次卡的共用
    """添加服务弹窗"""
    # 服务勾选框，随机一个，元素定位和次卡的共用
    # 确定按钮
    timeLimitCard_confirm_locator = (By.XPATH, '//*[contains(@aria-label,"时限卡")]//button[@class="el-button el-button--primary"]')
    # 选择有效期，默认选择一天
    # 单选卡片样式，元素定位和次卡的共用
    # 备注输入框，元素定位和次卡的共用
    # 售价输入框，元素定位和新增服务页面的共用
    # 划线价输入框，元素定位和新增服务页面的共用
    # 网店展示单选框，元素定位和新增服务页面的共用
    # 上下架单选框，元素定位和新增服务页面的共用
    # 排序增加按钮，元素定位和新增服务页面的共用
    # 提交卡项按钮，元素定位和新增服务页面的共用



    """产品页面"""
    # 产品标签
    product_label_locator = (By.XPATH, '//*[@class="page-title"]/li[3]')
    # 产品上下架状态按钮
    product_upDown_locator = (By.XPATH, '//*[@id="pane-1"]/div[2]/ul/li[3]/div[2]/div/div')
    # 产品上下架状态-上架选项
    product_putaway_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="已上架"]')
    # 产品上下架状态-下架选项
    product_unshelve_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li/span[text()="已下架"]')
    # 运费设置按钮
    freight_setBtn_locator = (By.XPATH, '//span[text()="运费设置"]')
    # 固定运费勾选
    fixedFreight_select_locator = (By.XPATH, '//*[@aria-label="设置运费"]//span[contains(text(),"固定运费")]')
    # 固定运费输入框
    fixedFreight_input_locator = (By.XPATH, '//span[contains(text(),"固定运费")]//input')
    # 订单满包邮勾选
    pinkage_select_locator = (By.XPATH, '//*[@aria-label="设置运费"]//span[contains(text(),"订单满")]')
    # 满多少金额输入框
    satisfyPinkage_input_locator = (By.XPATH, '//span[contains(text(),"订单满")]//div[1]/input')
    # 运费输入框
    freight_input_locator = (By.XPATH, '//span[contains(text(),"订单满")]//div[2]/input')
    # 运费确定按钮
    freight_confirm_locator = (By.XPATH, '//*[@id="app"]/div/div[2]/div[2]/div/div[2]/div/div[4]/div/div[3]/span/button[2]/span')

    """新增产品页面"""
    # 新增类型，自有产品
    own_products_locator = (By.XPATH, '//*[@class="el-radio__label" and text()="自有产品"]')
    # 产品名称输入框
    productName_input_locator = (By.XPATH, '//*[@placeholder="请输入20字以内的产品名称"]')
    # 产品分类按钮
    productCategory_btn_locator = (By.XPATH, '//*[contains(text(),"产品分类")]/following-sibling::div//input')
    # 产品分类下拉选项，随机选择一个
    productCategory_options_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li')
    # 产品标签按钮
    productLabel_btn_locator_locator = (By.XPATH, '//*[contains(text(),"产品标签")]/following-sibling::div//input')
    # 产品标签下拉选项，随机选择一个
    productLabel_options_locator = (By.XPATH, '//*[contains(@x-placement,"start")]//li')
    # 网店展示单选框，元素定位和新增服务页面的共用
    # 排序增加按钮，元素定位和新增服务页面的共用
    # 适用门店单选框，默认全部门店，元素定位和新增服务页面的共用
    # 添加规格类型按钮
    addStandard_btn_locator = (By.XPATH, '//*[@class="el-button el-button--primary"]/span[text()="添加规格类型"]')
    # 规格名称输入框
    standardName_input_locator = (By.XPATH, '//*[@placeholder="请输规格名称"]')
    # 添加规则项按钮
    addStandard_item_locator = (By.XPATH, '//*[@class="rule el-popover__reference"]')
    # 规则项输入框
    item_input_locator = (By.XPATH, '//*[@placeholder="请输入规格项名称"]')
    # 确定按钮
    item_confirm_locator = (By.XPATH, '//*[text()="添加规格项"]/../following-sibling::div//span[text()="确定"]')
    # 售价输入框
    productPrice_input_locator = (By.XPATH, '//*[@placeholder="售价"]')
    # 成本输入框
    cost_input_locator = (By.XPATH, '//*[@placeholder="成本"]')
    # 库存设定按钮
    storeSet_btn_locator = (By.XPATH, '//a[text()="设定"]')
    # 库存输入框，定位到多个门店
    store_inputs_locator = (By.XPATH, '//input[@placeholder="库存"]')
    # 库存确定按钮
    store_confirm_locator = (By.XPATH, '//*[@aria-label="设定库存"]//button[@class="el-button el-button--primary"]')
    # 产品详情输入框,元素定位和新增服务页面的服务详情输入框共用
    # 提交产品按钮，元素定位和新增服务页面的共用
    """管理产品分类页面"""
    # 管理产品分类按钮
    manage_productCategory_locator = (By.XPATH, '//div[@class="headquarters_Label"]/span[2]')
    # 新增分类按钮
    product_newCategory_locator = (By.XPATH, '//*[text()="新增分类"]')
    # 分类名称输入框
    product_categoryName_locator = (By.XPATH, '//*[text()="添加分类"]/following-sibling::div/input')
    # 确定按钮
    confirm_productCategory_locator = (By.XPATH, '//*[@x-placement="right"]//*[@class="el-button el-button--primary el-button--mini"]')
    # 编辑按钮
    edit_productCategory_locator = (By.XPATH, '//*[@aria-label="管理产品分类"]//ul[2]/li[4]/span[1]')
    # 编辑分类名称输入框
    edit_productCategoryName_locator = (By.XPATH, '//*[@aria-label="管理产品分类"]//ul[2]/li[1]//input')
    # 编辑保存按钮
    edit_productSaveBtn_locator = (By.XPATH, '//*[@aria-label="管理产品分类"]//ul[2]/li[1]/div/span[1]')
    # 删除按钮
    del_productCategory_locator = (By.XPATH, '//*[@aria-label="管理产品分类"]//ul[2]/li[4]/span[2]')
    # 分类名称
    productCategory_name_locator = (By.XPATH, '//*[@aria-label="管理产品分类"]//ul[2]/li[1]/span')
    # 关闭管理产品分类弹窗按钮
    cancel_productCategoryPopup_locator = (By.XPATH, '//*[@aria-label="管理产品分类"]/div/button')

    """管理产品标签弹窗页面元素"""
    # 管理产品标签按钮
    manage_productLabel_locator = (By.XPATH, '//div[@class="headquarters_Label"]/span[3]')
    # 新增标签按钮
    newProductLabel_btn_locator = (By.XPATH, '//*[text()="新增标签"]')
    # 标签名称输入框
    serveProductName_input_locator = (By.XPATH, '//*[text()="添加标签"]/following-sibling::div/input')
    # 确定按钮
    confirm_productLabel_locator = (By.XPATH, '//*[@x-placement="right"]//*[@class="el-button el-button--primary el-button--mini"]')
    # 取消按钮
    cancel_productLabel_locator = (By.XPATH, '//*[@x-placement="right"]//*[@class="el-button el-button--default el-button--mini"]')
    # 编辑按钮
    edit_productLabel_locator = (By.XPATH, '//*[@aria-label="管理产品标签"]//ul[2]/li[4]/span[1]')
    # 编辑标签名称输入框
    edit_productLabelName_locator = (By.XPATH, '//*[@aria-label="管理产品标签"]//ul[2]/li[1]//input')
    # 编辑保存按钮
    edit_productLabelSave_locator = (By.XPATH, '//*[@aria-label="管理产品标签"]//ul[2]/li[1]/div/span[1]')
    # 删除按钮
    del_productLabel_locator = (By.XPATH, '//*[@aria-label="管理产品标签"]//ul[2]/li[4]/span[2]')
    # 标签名称
    productLabel_name_locator = (By.XPATH, '//*[@aria-label="管理产品标签"]//ul[2]/li[1]/span')
    # 关闭管理产品标签弹窗按钮
    cancel_productLabelPopup_locator = (By.XPATH, '//*[@aria-label="管理产品标签"]/div/button')

    """门店产品页面元素"""
    # 门店产品标签
    storeProduct_label_locator = (By.XPATH, '//div[@class="el-tabs__item is-top"]/span[text()="门店产品"]')
    # 编辑按钮，随机选择一个
    edit_shopProduct_locator = (By.XPATH, '//*[@id="pane-2"]/div[2]/div/div[4]/div[2]/table/tbody/tr[1]/td[6]/div/a')


    """服务页面功能"""
    @allure.step('点击新增按钮')
    def click_newAdd(self):
        """服务、卡项、产品新增共用"""
        time.sleep(1)
        self.sleep_wait(self.newAdd_btn_locator).click()

    @allure.step('查询总部数据信息')
    # 服务、产品、卡项共用
    def HQ_search(self,name):
        serveName = self.visible_only_wait(self.HQ_searchInput_locator)
        # self.scrollIntoView(serveName)
        serveName.clear()
        serveName.send_keys(name)
        self.clickable_wait(self.HQ_searchBtn_locator).click()

    @allure.step('获取总部数据名称')
    # 服务、产品、卡项共用
    def get_HQ_Name(self):
        return self.visible_only_wait(self.HQ_Name_locator)

    @allure.step('获取总部数据名称')
    def get_HQ_Name(self):
        return self.visible_only_wait(self.HQ_Name_locator)


    @allure.step('点击服务上下架状态按钮')
    def click_serve_upDown(self):
        time.sleep(2)
        self.clickable_wait(self.serve_upDown_locator).click()

    @allure.step('根据服务上下架状态查询-已上架')
    def search_serve_putaway(self):
        self.click_serve_upDown()
        elem = self.clickable_wait(self.serve_putaway_locator)
        self.JS_click(elem)

    @allure.step('根据服务上下架状态查询-已下架')
    def search_serve_unshelve(self):
        self.click_serve_upDown()
        elem = self.clickable_wait(self.serve_unshelve_locator)
        self.JS_click(elem)


    """新增服务页面功能"""

    @allure.step('输入服务名称')
    def input_serveName(self,serveName):
        serveName_input = self.visible_only_wait(self.serveName_input_locator)
        serveName_input.clear()
        serveName_input.send_keys(serveName)

    @allure.step('选择服务分类')
    def select_serveCategory(self):
        self.clickable_wait(self.serveCategory_btn_locator).click()
        serveCategorys = self.visible_least_wait(self.serveCategory_options_locator)
        self.random_JSselect_click(serveCategorys)

    @allure.step('选择服务标签')
    def select_serveLabel(self):
        self.clickable_wait(self.serveLabel_btn_locator).click()
        serveLabels = self.visible_least_wait(self.serveLabel_options_locator)
        self.random_select_click(serveLabels)


    @allure.step('上传图片')
    def upload_image(self):
        self.presence_only_wait(self.upload_locator).send_keys(cons.IMAGE_PATH)

    @allure.step('输入售价')
    def input_price(self,price=200):
        price_input = self.visible_only_wait(self.price_input_locator)
        price_input.clear()
        price_input.send_keys(price)

    @allure.step('输入划线价')
    def input_linePrice(self,price=100):
        linePrice_input = self.visible_only_wait(self.linePrice_input_locator)
        linePrice_input.clear()
        linePrice_input.send_keys(price)


    @allure.step('选择上架')
    def select_onlineStore(self):
        self.clickable_wait(self.onlineStore_show_locator).click()


    @allure.step('输入详情信息')
    def input_serveDetail(self,detail="详情信息"):
       elem = self.visible_only_wait(self.serveDetail_input_locator)
       elem.send_keys(detail)


    @allure.step('点击提交')
    def click_submit(self):
        self.clickable_wait(self.submit_btn_locator).click()


    @allure.step('新增服务')
    def newAdd_serve(self,serveName):
        self.click_newAdd()
        self.input_serveName(serveName)
        self.select_serveCategory()
        self.select_serveLabel()
        self.upload_image()
        self.input_price()
        self.input_linePrice()
        self.input_serveDetail()
        self.click_submit()

    @allure.step('获取提示信息')
    def get_prompt_msg(self):
        time.sleep(2)
        return self.presence_only_wait(self.prompt_msg_locator)

    """服务编辑功能"""
    @allure.step('点击服务编辑按钮')
    def click_serveEdit(self):
        time.sleep(1)
        self.clickable_wait(self.serveEdit_btn_locator).click()

    @allure.step('进行服务编辑')
    def serveEdit(self,serveName):
        self.click_serveEdit()
        self.input_serveName(serveName)
        self.select_serveCategory()
        self.input_price()
        self.click_submit()


    @allure.step('点击上架按钮')
    def click_putaway(self):
        self.clickable_wait(self.putaway_btn_locator).click()

    @allure.step('点击下架按钮')
    def click_unshelve(self):
        self.clickable_wait(self.unshelve_btn_locator).click()

    @allure.step('点击上下架确定按钮')
    def click_confirm_upDown(self):
        self.clickable_wait(self.confirm_upDown_locator).click()


    """管理服务分类功能"""

    @allure.step('点击管理服务分类按钮')
    def click_manage_serveCategory(self):
        self.clickable_wait(self.manage_serveCategory_locator).click()

    @allure.step('点击新增分类按钮')
    def click_newCategory(self):
        self.clickable_wait(self.newCategory_btn_locator).click()

    @allure.step('输入分类名称')
    def input_categoryName(self,name):
        self.visible_only_wait(self.categoryName_input_locator).send_keys(name)

    @allure.step('点击分类确定按钮')
    def click_confirm_Category(self):
        self.clickable_wait(self.confirm_Category_locator).click()

    @allure.step('点击分类编辑按钮')
    def click_edit_Category(self):
        self.clickable_wait(self.edit_Category_locator).click()

    @allure.step('输入修改的分类名称')
    def input_edit_categoryName(self,name):
        categoryName = self.visible_only_wait(self.edit_categoryName_locator)
        categoryName.clear()
        categoryName.send_keys(name)

    @allure.step('点击分类保存按钮')
    def click_edit_saveBtn(self):
        self.clickable_wait(self.edit_saveBtn_locator).click()

    @allure.step('点击删除按钮后，并关闭管理服务分类弹窗')
    def click_del_Category(self):
        self.clickable_wait(self.del_Category_locator).click()
        self.clickable_wait(self.cancel_CategoryPopup_locator).click()

    @allure.step('获取服务分类名称')
    def get_Category_name(self):
        time.sleep(2)
        return self.visible_only_wait(self.Category_name_locator)

    """管理服务标签功能"""

    @allure.step('点击管理服务标签按钮')
    def click_manage_serveLabel(self):
        self.clickable_wait(self.manage_serveLabel_locator).click()

    @allure.step('点击新增标签按钮')
    def click_newServeLabel_btn(self):
        self.clickable_wait(self.newServeLabel_btn_locator).click()

    @allure.step('输入标签名称')
    def input_labelName(self,name):
        self.visible_only_wait(self.serveLabelName_input_locator).send_keys(name)

    @allure.step('点击标签确定按钮')
    def click_confirm_label(self):
        self.clickable_wait(self.confirm_serveLabel_locator).click()

    @allure.step('点击标签编辑按钮')
    def click_edit_serveLabel(self):
        self.clickable_wait(self.edit_serveLabel_locator).click()

    @allure.step('输入修改的标签名称')
    def input_edit_serveLabelName(self,name):
        serveLabelName = self.visible_only_wait(self.edit_serveLabelName_locator)
        serveLabelName.clear()
        serveLabelName.send_keys(name)

    @allure.step('点击标签保存按钮')
    def click_edit_serveLabelSave(self):
        self.clickable_wait(self.edit_serveLabelSave_locator).click()

    @allure.step('点击标签删除按钮，并关闭管理服务标签弹窗')
    def click_del_serveLabel(self):
        self.clickable_wait(self.del_serveLabel_locator).click()
        self.clickable_wait(self.cancel_serveLabelPopup_locator).click()

    @allure.step('获取服务标签名称')
    def get_serveLabel_name(self):
        time.sleep(2)
        return self.visible_only_wait(self.serveLabel_name_locator)

    """门店服务功能"""

    @allure.step('点击门店服务标签')
    def click_storeServe_label(self):
        self.clickable_wait(self.storeServe_label_locator).click()

    @allure.step('查询门店数据信息')
    def shop_search(self,name):
        input = self.visible_only_wait(self.shopServe_searchInput_locator)
        input.clear()
        input.send_keys(name)
        self.clickable_wait(self.shopServe_searchBtn_locator).click()

    @allure.step('获取门店数据名称')
    def get_shop_Name(self):
        return self.visible_only_wait(self.shop_serveName_locator)

    @allure.step('门店服务-查看服务信息')
    def check_shopServe(self):
        self.clickable_wait(self.check_shopServe_locator).click()

    @allure.step('获取服务详情页面的基本信息标题')
    def get_shopServe_detail(self):
        return self.visible_only_wait(self.shopServe_detail_locator)


    """卡项页面功能"""

    @allure.step('点击卡项标签')
    def click_cardOption_label(self):
        self.sleep_wait(self.cardOption_label_locator).click()

    @allure.step('点击选择分类按钮')
    def click_cardOption_btn(self):
        time.sleep(2)
        self.clickable_wait(self.cardOption_btn_locator).click()


    @allure.step('根据卡项分类查询-次卡')
    def search_countCard(self):
        self.click_cardOption_btn()
        elem = self.clickable_wait(self.cardOption_countCard_locator)
        self.JS_click(elem)

    @allure.step('根据卡项分类查询-折扣卡')
    def search_discountCard(self):
        self.click_cardOption_btn()
        elem = self.clickable_wait(self.cardOption_discountCard_locator)
        self.JS_click(elem)

    @allure.step('根据卡项分类查询-充值卡')
    def search_rechargeCard(self):
        self.click_cardOption_btn()
        elem = self.clickable_wait(self.cardOption_rechargeCard_locator)
        self.JS_click(elem)

    @allure.step('根据卡项分类查询-套卡')
    def search_SetCard(self):
        self.click_cardOption_btn()
        elem = self.clickable_wait(self.cardOption_SetCard_locator)
        self.JS_click(elem)

    @allure.step('根据卡项分类查询-时限卡')
    def search_timeLimitCard(self):
        self.click_cardOption_btn()
        elem = self.clickable_wait(self.cardOption_timeLimitCard_locator)
        self.JS_click(elem)

    @allure.step('点击卡项上下架状态按钮')
    def click_cardOption_upDown(self):
        time.sleep(2)
        self.clickable_wait(self.cardOption_upDown_locator).click()

    @allure.step('根据卡项上下架状态查询-已上架')
    def search_cardOption_putaway(self):
        self.click_cardOption_upDown()
        elem = self.clickable_wait(self.cardOption_putaway_locator)
        self.JS_click(elem)

    @allure.step('根据卡项上下架状态查询-已下架')
    def search_cardOption_unshelve(self):
        self.click_cardOption_upDown()
        elem = self.clickable_wait(self.cardOption_unshelve_locator)
        self.JS_click(elem)

    """门店卡项页面功能"""
    @allure.step('点击门店卡项标签')
    def click_shopCardOption_label(self):
        time.sleep(2)
        self.clickable_wait(self.shopCardOption_label_locator).click()


    """新增卡项页面功能"""

    @allure.step('选择折扣卡')
    def select_discountCard(self):
        self.clickable_wait(self.discountCard_checkbox_locator).click()

    @allure.step('选择充值卡')
    def select_rechargeCard(self):
        self.clickable_wait(self.rechargeCard_checkbox_locator).click()

    @allure.step('选择套卡')
    def select_SetCard(self):
        self.clickable_wait(self.SetCard_checkbox_locator).click()

    @allure.step('选择时限卡')
    def select_timeLimitCard(self):
        self.clickable_wait(self.timeLimitCard_checkbox_locator).click()

    @allure.step('输入卡项名称')
    def input_cardOption_name(self,name):
        input = self.visible_only_wait(self.cardOption_name_locator)
        input.clear()
        input.send_keys(name)

    @allure.step('点击添加服务按钮')
    def click_add_serve(self):
        self.clickable_wait(self.add_serve_locator).click()

    @allure.step('点击套卡-添加服务按钮')
    def click_add_serveP(self):
        self.clickable_wait(self.add_serveP_locator).click()

    @allure.step('随机添加一个服务')
    def select_serve_checkbox(self):
        checkboxs = self.visible_least_wait(self.serve_checkboxs_locator)
        self.random_select_click(checkboxs)

    @allure.step('点击次卡-添加服务确定按钮')
    def click_countCard_confirm(self):
        self.clickable_wait(self.countCard_confirm_locator).click()

    @allure.step('点击折扣卡-添加服务确定按钮')
    def click_discountCard_confirm(self):
        self.clickable_wait(self.discountCard_confirm_locator).click()

    @allure.step('点击套卡-添加服务确定按钮')
    def click_SetCard_confirm(self):
        self.clickable_wait(self.SetCard_confirm_locator).click()

    @allure.step('点击时限卡-添加服务确定按钮')
    def click_timeLimitCard_confirm(self):
        self.clickable_wait(self.timeLimitCard_confirm_locator).click()

    @allure.step('选择有效期-一天')
    # 时效卡例外，已默认选择一天
    def indate_select(self):
        self.clickable_wait(self.indate_select_locator).click()

    @allure.step('输入备注')
    def input_remark(self,remark="卡项备注"):
        self.visible_only_wait(self.remark_input_locator).send_keys(remark)

    @allure.step('充值卡-输入充值金额')
    def input_rechargeAmount(self,amount=1000):
        input = self.visible_only_wait(self.rechargeAmount_input_locator)
        input.clear()
        input.send_keys(amount)

    @allure.step('充值卡-输入赠送金额')
    def input_givenAmount(self,amount=100):
        input = self.visible_only_wait(self.givenAmount_input_locator)
        input.clear()
        input.send_keys(amount)

    @allure.step('套卡-点击添加产品按钮')
    def click_add_product(self):
        self.clickable_wait(self.add_product_locator).click()

    @allure.step('套卡-随机选择产品')
    def select_add_btn(self):
        selects = self.visible_least_wait(self.add_btn_locator)
        self.random_select_click(selects)

    @allure.step('套卡-选择产品规格')
    def select_standard(self):
        selects = self.visible_least_wait(self.standard_select_locator)
        for i in selects:
            i.click()

    @allure.step('套卡-产品规格确定')
    def standard_confirm(self):
        self.clickable_wait(self.standard_confirm_locator).click()

    @allure.step('套卡-产品确定')
    def product_confirm(self):
        self.clickable_wait(self.product_confirm_locator).click()


    @allure.step('新增次卡')
    def newAdd_countCard(self,name):
        self.click_cardOption_label()
        self.click_newAdd()
        self.input_cardOption_name(name)
        self.click_add_serve()
        self.select_serve_checkbox()
        self.click_countCard_confirm()
        self.indate_select()
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    @allure.step('新增折扣卡')
    def newAdd_discountCard(self,name):
        self.click_cardOption_label()
        self.click_newAdd()
        self.select_discountCard()
        self.input_cardOption_name(name)
        self.click_add_serve()
        self.select_serve_checkbox()
        self.click_discountCard_confirm()
        self.indate_select()
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    @allure.step('新增充值卡')
    def newAdd_rechargeCard(self,name):
        self.click_cardOption_label()
        self.click_newAdd()
        self.select_rechargeCard()
        self.input_cardOption_name(name)
        self.indate_select()
        self.input_remark()
        self.input_rechargeAmount()
        self.input_givenAmount()
        self.input_linePrice()
        self.click_submit()

    @allure.step('新增套卡')
    def newAdd_SetCard(self,name):
        self.click_cardOption_label()
        self.click_newAdd()
        self.select_SetCard()
        self.input_cardOption_name(name)
        self.click_add_serveP()
        self.select_serve_checkbox()
        self.click_SetCard_confirm()
        self.click_add_product()
        self.select_add_btn()
        self.select_standard()
        self.standard_confirm()
        self.product_confirm()
        self.indate_select()
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    @allure.step('新增时限卡')
    def newAdd_timeLimitCard(self,name):
        self.click_cardOption_label()
        self.click_newAdd()
        self.select_timeLimitCard()
        self.input_cardOption_name(name)
        self.click_add_serve()
        self.select_serve_checkbox()
        self.click_timeLimitCard_confirm()
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    @allure.step('编辑次卡')
    def edit_countCard(self,name):
        self.click_cardOption_label()
        self.search_countCard()
        self.click_serveEdit()
        self.input_cardOption_name(name)
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    @allure.step('编辑折扣卡')
    def edit_discountCard(self,name):
        self.click_cardOption_label()
        self.search_discountCard()
        self.click_serveEdit()
        self.input_cardOption_name(name)
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    @allure.step('编辑充值卡')
    def edit_rechargeCard(self,name):
        self.click_cardOption_label()
        self.search_rechargeCard()
        self.click_serveEdit()
        self.input_cardOption_name(name)
        self.input_remark()
        self.input_rechargeAmount()
        self.input_givenAmount()
        self.input_linePrice()
        self.click_submit()

    @allure.step('编辑套卡')
    def edit_SetCard(self,name):
        self.click_cardOption_label()
        self.search_SetCard()
        self.click_serveEdit()
        self.input_cardOption_name(name)
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    @allure.step('编辑时限卡')
    def edit_timeLimitCard(self,name):
        self.click_cardOption_label()
        self.search_timeLimitCard()
        self.click_serveEdit()
        self.input_cardOption_name(name)
        self.input_remark()
        self.input_price()
        self.input_linePrice()
        self.click_submit()

    """产品页面功能"""

    @allure.step('点击产品标签')
    def click_product_label(self):
        self.clickable_wait(self.product_label_locator).click()

    @allure.step('点击产品上下架状态按钮')
    def click_product_upDown(self):
        time.sleep(2)
        self.clickable_wait(self.product_upDown_locator).click()

    @allure.step('根据产品上下架状态查询-已上架')
    def search_product_putaway(self):
        self.click_product_upDown()
        elem = self.clickable_wait(self.product_putaway_locator)
        self.JS_click(elem)

    @allure.step('根据产品上下架状态查询-已下架')
    def search_product_unshelve(self):
        self.click_cardOption_upDown()
        elem = self.clickable_wait(self.product_unshelve_locator)
        self.JS_click(elem)

    """新增产品页面功能"""

    @allure.step('输入产品名称')
    def input_productName(self,name):
        input = self.visible_only_wait(self.productName_input_locator)
        input.clear()
        input.send_keys(name)

    @allure.step('点击产品分类按钮')
    def click_productCategory_btn(self):
        self.clickable_wait(self.productCategory_btn_locator).click()

    @allure.step('随机选择一个产品分类下拉项')
    def select_productCategory_options(self):
        elem = self.presence_least_wait(self.productCategory_options_locator)
        self.random_JSselect_click(elem)

    @allure.step('点击产品标签按钮')
    def click_productLabel_btn(self):
        self.clickable_wait(self.productLabel_btn_locator_locator).click()

    @allure.step('随机选择一个产品分类下拉项')
    def select_productLabel_options(self):
        time.sleep(2)
        elem = self.presence_least_wait(self.productLabel_options_locator)
        self.random_JSselect_click(elem)

    # @allure.step('点击添加规格类型按钮')
    # def click_addStandard_btn(self):
    #     self.clickable_wait(self.addStandard_btn_locator).click()

    @allure.step('输入规格名称')
    def input_standardName(self,name):
        self.visible_only_wait(self.standardName_input_locator).send_keys(name)

    @allure.step('点击添加规则项按钮')
    def click_addStandard_item(self):
        self.clickable_wait(self.addStandard_item_locator).click()

    @allure.step('输入规则项')
    def input_item(self, name):
        self.visible_only_wait(self.item_input_locator).send_keys(name)

    @allure.step('点击规则项确定按钮')
    def click_item_confirm(self):
        self.clickable_wait(self.item_confirm_locator).click()

    @allure.step('输入售价')
    def input_productPrice(self, price=500):
        self.visible_only_wait(self.productPrice_input_locator).send_keys(price)

    @allure.step('输入成本')
    def input_cost(self, price=200):
        self.visible_only_wait(self.cost_input_locator).send_keys(price)

    @allure.step('点击库存设定按钮')
    def click_storeSet_btn(self):
        self.clickable_wait(self.storeSet_btn_locator).click()

    @allure.step('输入库存,多个门店，全部输入')
    def input_store(self, num=100):
        elems = self.visible_least_wait(self.store_inputs_locator)
        for i in elems:
            i.send_keys(num)

    @allure.step('点击库存确定按钮')
    def click_store_confirm(self):
        self.clickable_wait(self.store_confirm_locator).click()


    @allure.step('新增产品')
    def newProduct(self,name):
        self.click_product_label()
        self.click_newAdd()
        self.input_productName(name)
        self.click_productCategory_btn()
        self.select_productCategory_options()
        self.click_productLabel_btn()
        self.select_productLabel_options()
        self.upload_image()
        self.input_standardName(name)
        self.click_addStandard_item()
        self.input_item(name)
        self.click_item_confirm()
        self.input_productPrice()
        self.input_cost()
        self.click_storeSet_btn()
        self.input_store()
        self.click_store_confirm()
        self.input_serveDetail()
        self.click_submit()

    @allure.step('编辑产品')
    def editProduct(self,name):
        self.click_product_label()
        self.click_serveEdit()
        self.input_productName(name)
        self.click_productCategory_btn()
        self.select_productCategory_options()
        self.click_submit()


    """管理产品分类功能"""

    @allure.step('点击管理产品分类按钮')
    def click_manage_productCategory(self):
        time.sleep(1)
        self.clickable_wait(self.manage_productCategory_locator).click()

    @allure.step('点击新增分类按钮')
    def click_product_newCategory(self):
        self.clickable_wait(self.product_newCategory_locator).click()

    @allure.step('输入分类名称')
    def input_product_categoryName(self,name):
        self.visible_only_wait(self.product_categoryName_locator).send_keys(name)

    @allure.step('点击分类确定按钮')
    def click_confirm_productCategory(self):
        self.clickable_wait(self.confirm_productCategory_locator).click()

    @allure.step('点击分类编辑按钮')
    def click_edit_productCategory(self):
        self.clickable_wait(self.edit_productCategory_locator).click()

    @allure.step('输入修改的分类名称')
    def input_edit_productCategoryName(self,name):
        categoryName = self.visible_only_wait(self.edit_productCategoryName_locator)
        categoryName.clear()
        categoryName.send_keys(name)

    @allure.step('点击分类保存按钮')
    def click_edit_productSaveBtn(self):
        self.clickable_wait(self.edit_productSaveBtn_locator).click()

    @allure.step('点击删除按钮后，并关闭管理产品分类弹窗')
    def click_del_productCategory(self):
        self.clickable_wait(self.del_productCategory_locator).click()
        self.clickable_wait(self.cancel_productCategoryPopup_locator).click()

    @allure.step('获取产品分类名称')
    def get_productCategory_name(self):
        time.sleep(2)
        return self.visible_only_wait(self.productCategory_name_locator)

    """管理产品标签功能"""

    @allure.step('点击管理产品标签按钮')
    def click_manage_productLabel(self):
        time.sleep(1)
        self.clickable_wait(self.manage_productLabel_locator).click()

    @allure.step('点击新增标签按钮')
    def click_newProductLabel_btn(self):
        self.clickable_wait(self.newProductLabel_btn_locator).click()

    @allure.step('输入标签名称')
    def input_productLabelName(self,name):
        self.visible_only_wait(self.serveProductName_input_locator).send_keys(name)

    @allure.step('点击标签确定按钮')
    def click_confirm_productLabel(self):
        self.clickable_wait(self.confirm_productLabel_locator).click()

    @allure.step('点击标签编辑按钮')
    def click_edit_productLabel(self):
        self.clickable_wait(self.edit_productLabel_locator).click()

    @allure.step('输入修改的标签名称')
    def input_edit_productLabelName(self,name):
        serveLabelName = self.visible_only_wait(self.edit_productLabelName_locator)
        serveLabelName.clear()
        serveLabelName.send_keys(name)

    @allure.step('点击标签保存按钮')
    def click_edit_productLabelSave(self):
        self.clickable_wait(self.edit_productLabelSave_locator).click()

    @allure.step('点击标签删除按钮，并关闭管理产品标签弹窗')
    def click_del_productLabel(self):
        self.clickable_wait(self.del_productLabel_locator).click()
        self.clickable_wait(self.cancel_productLabelPopup_locator).click()

    @allure.step('获取产品标签名称')
    def get_productLabel_name(self):
        time.sleep(2)
        return self.visible_only_wait(self.productLabel_name_locator)

    """门店产品页面功能"""

    @allure.step('点击门店产品标签')
    def click_storeProduct_label(self):
        self.clickable_wait(self.storeProduct_label_locator).click()

    @allure.step('点击门店产品-编辑按钮')
    def click_edit_shopProduct(self):
        self.clickable_wait(self.edit_shopProduct_locator).click()

    @allure.step('编辑门店产品')
    def edit_shopProduct(self,name):
        self.input_productName(name)
        self.click_productCategory_btn()
        self.select_productCategory_options()
        self.click_submit()

    @allure.step('点击运费设置按钮')
    def click_freight_setBtn(self):
        self.clickable_wait(self.freight_setBtn_locator).click()

    @allure.step('选择固定运费')
    def select_fixedFreight(self):
        self.clickable_wait(self.fixedFreight_select_locator).click()

    @allure.step('输入固定运费')
    def input_fixedFreight(self,price=12):
        input = self.visible_only_wait(self.fixedFreight_input_locator)
        input.clear()
        input.send_keys(price)

    @allure.step('选择订单满包邮')
    def select_pinkage(self):
        self.clickable_wait(self.pinkage_select_locator).click()

    @allure.step('输入满多少金额')
    def input_satisfyPinkage(self,price=100):
        input = self.visible_only_wait(self.satisfyPinkage_input_locator)
        input.clear()
        input.send_keys(price)

    @allure.step('输入运费')
    def input_freight(self,price=12):
        input = self.visible_only_wait(self.freight_input_locator)
        input.clear()
        input.send_keys(price)

    @allure.step('点击运费确定按钮')
    def click_freight_confirm(self):
        self.clickable_wait(self.freight_confirm_locator).click()








